package crud.client.data;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;

@Embeddable
public class CataloguePk implements Serializable
{
	@Column(name="CODE_TABLE")
	private String codeTable;

	@Column(name="CODE_DETAIL")
	private String codeDetail;
	
	
	public CataloguePk()
	{
	}
	
	public CataloguePk(String codeTable, String codeDetail)
	{
		this.codeTable = codeTable;
		this.codeDetail = codeDetail;
	}

	@Override
	public boolean equals(Object cataloguePk)
	{
		return 
			this.getCodeTable().equals(((CataloguePk) cataloguePk).getCodeTable()) && 
			this.getCodeDetail().equals((((CataloguePk) cataloguePk).getCodeDetail())); 
	}

	@Override
	public int hashCode()
	{
		return 
			3 * this.getCodeTable().hashCode() + 
			5 * this.getCodeDetail().hashCode();
	}


	@Column(name="CODE_TABLE")
	@Id public String getCodeTable()
	{
		return codeTable;
	}

	public void setCodeTable(String codeTable)
	{
		this.codeTable = codeTable;
	}

	@Column(name="CODE_DETAIL")
	@Id public String getCodeDetail()
	{
		return codeDetail;
	}

	public void setCodeDetail(String codeDetail)
	{
		this.codeDetail = codeDetail;
	}

	
	
}
